@using NBitcoin.DataEncoders
@using NBitcoin
@model BTCPayServer.Components.LabelManager.LabelViewModel
@{
    var elementId = "a" + Encoders.Base58.EncodeData(RandomUtils.GetBytes(16));
    var fetchUrl = Url.Action("LabelsJson", "UIWallets", new {
        walletId = Model.WalletObjectId.WalletId,
        excludeTypes = Safe.Json(Model.ExcludeTypes)
    });
    var updateUrl = Model.AutoUpdate? Url.Action("UpdateLabels", "UIWallets", new {
        walletId = Model.WalletObjectId.WalletId
    }): string.Empty;
}
<input id="@elementId" placeholder=@StringLocalizer["Select labels"] autocomplete="off" value="@string.Join(",", Model.SelectedLabels)"
       class="only-for-js form-control label-manager ts-wrapper @(Model.DisplayInline ? "ts-inline" : "")"
       data-fetch-url="@fetchUrl"
       data-update-url="@updateUrl"
       data-wallet-id="@Model.WalletObjectId.WalletId"
       data-wallet-object-id="@Model.WalletObjectId.Id"
       data-wallet-object-type="@Model.WalletObjectId.Type"
       data-select-element="@Model.SelectElement"
       data-labels='@Safe.Json(Model.RichLabelInfo)' />
